package com.sunhao.gulimall.member.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sunhao.common.utils.PageUtils;
import com.sunhao.gulimall.member.entity.MemberEntity;
import com.sunhao.gulimall.member.exception.PhoneExistException;
import com.sunhao.gulimall.member.exception.UserNameExistException;
import com.sunhao.gulimall.member.vo.MemberLoginVo;
import com.sunhao.gulimall.member.vo.MemberRegisterVo;
import com.sunhao.gulimall.member.vo.SocialUser;

import java.util.Map;

/**
 * 会员
 *
 * @author sunhao
 * @email 19851621327@163.com
 * @date 2024-08-11 14:34:30
 */
public interface MemberService extends IService<MemberEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 注册用户
     * @param vo
     */
    void register(MemberRegisterVo vo);

    /**
     * 验证手机号唯一性
     * @param phone
     * @return
     */
    void checkPhoneUnique(String phone) throws PhoneExistException;

    /**
     * 验证用户名唯一性
     * @param username
     * @return
     */
    void checkUserNameUnique(String username) throws UserNameExistException;

    /**
     * 用户登录
     * @param vo
     * @return
     */
    MemberEntity login(MemberLoginVo vo);

    /**
     * 微博第三方登录
     * @param socialUser 微博授权后获取的token uid等信息
     * @return
     */
    MemberEntity login(SocialUser socialUser) throws Exception;
}

